<?php

namespace Modules\Test\Providers;

use Duxravel\Core\UI\Table;
use Illuminate\Support\Facades\View;
use Illuminate\Support\HtmlString;
use Illuminate\Support\ServiceProvider;

class TestProviders extends ServiceProvider
{

    public function register()
    {
//        // 注册中间件
//        $this->app['router']->aliasMiddleware('wechat.oauth', '类名');
//
//        // 分组中间件追加
//        $this->app['kernel']->appendMiddlewareToGroup('web', '类名');

    }

    public function boot()
    {
        View::composer('*',function ($view){
            $html = [];
            foreach (glob(module_path('Test/Component/*.vue')) as $vo) {
                $html[] = new HtmlString(file_get_contents($vo));
            }
            $view->with('vueComponents',implode("",$html));
        });
    }
}
